﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Manage.Master" AutoEventWireup="true"
    CodeBehind="EstateList.aspx.cs" Inherits="ZF.WS.Admin.service.EstateList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <!--自定义条件 开始-->
    <%--   <div class="tabHeadMenu">
        <a href="HouseList.aspx?days=7" class='<%=(DealType==-1 && IsBoutique==0)?"action":"" %>'>全部房源</a> <a
            href="HouseList.aspx?dt=1&days=7" class='<%=(DealType==1)?"action":"" %>'>整租房源</a>
        <a href="HouseList.aspx?dt=2&days=7" class='<%=(DealType==2)?"action":"" %>'>合租房源</a>
        <a href="HouseList.aspx?dt=3&days=7" class='<%=(DealType==3)?"action":"" %>'>二手房源</a>
        <a href="HouseList.aspx?dt=4&days=7" class='<%=(DealType==4)?"action":"" %>'>一手房源</a>
        <a href="HouseList.aspx?jp=1" class='<%=(IsBoutique==1)?"action":"" %>'>精品楼盘</a>
    </div>--%>
    <!--自定义条件 结束-->
    <!--列表 开始-->
    <div class="tabContainer">
        <zf:GridView ID="gvList" runat="server" OnSorting="gvListSorting" OnPageIndexChanging="gvListPageChanging">
            <Columns>
                <zf:TemplateField IsKeyField="true" DefaultSortField="true" DefaultSortDirection="Descending"
                    SortExpression="House.EstateId">
                    <ItemTemplate>
                        <asp:Label runat="server" ID="KeyLabel" Text='<%# Eval("House.EstateId")%>'></asp:Label>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField IsCheckField="true">
                </zf:TemplateField>
                <zf:TemplateField IsSerialNoField="true">
                </zf:TemplateField>
                <%-- <zf:TemplateField HeaderText="房源编号" DefaultSortDirection="Descending" SortExpression="House.EstateId">
                    <ItemTemplate>
                        <%#  10000+(int)Eval("House.EstateId")%>
                    </ItemTemplate>
                </zf:TemplateField>--%>
                <zf:TemplateField HeaderText="发布时间" DefaultSortDirection="Descending" SortExpression="House.AddTime">
                    <ItemTemplate>
                        <%#  Eval("House.AddTime")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="区域">
                    <ItemTemplate>
                        <%# Eval("City")%><%# Eval("Area") == null ? "" : string.Format("({0})", Eval("Area")) %>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="物业名称">
                    <ItemTemplate>
                        <%# Eval("House.Title")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="物业类型">
                    <ItemTemplate>
                        <%# Eval("HouseType")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="价格(元/㎡)">
                    <ItemTemplate>
                        <%# Eval("Price")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <zf:TemplateField HeaderText="联系人">
                    <ItemTemplate>
                        <%# Eval("House.Contact")%>
                    </ItemTemplate>
                </zf:TemplateField>
                <%--   <zf:TemplateField HeaderText="联系人">
                    <ItemTemplate>
                        <%# GetStatus((int) Eval("House.Status"))%>
                    </ItemTemplate>
                </zf:TemplateField>--%>
                <zf:TemplateField HeaderText="操作">
                    <ItemTemplate>
                        <a href='/house/estateInfo.aspx?hid=<%# Eval("House.EstateId")%>' target="_blank">查看</a>
                        | <a href='estateManage.aspx?ot=Edit&hid=<%# Eval("House.EstateId")%>'>修改</a> |
                        <zf:LinkButton ID="LinkButton1" runat="server" OnClick="Delete" CommandArgument='<%# Eval("House.EstateId") %>'
                            OnClientClick="return confirm('是否确定要删除此记录');">删除</zf:LinkButton>
                    </ItemTemplate>
                </zf:TemplateField>
            </Columns>
        </zf:GridView>
    </div>
    <!--列表 结束-->
    <div class="mt5_ fc_">
    </div>
    <!--自定义按钮 开始-->
    <div class="btnContainer mt10_">
        <span class="fl_ mr10_">
            <input type="checkbox" class="checkAll" bind=".tab" />选中本页显示的所有<%=this.CTitle %></span>
        <zf:LinkButton ID="LinkButton1" runat="server" OnClick="Delete" CommandArgument='select'
            OnClientClick="return confirm('是否确定要删除选中记录');">删除选中的<%=this.CTitle %></zf:LinkButton>
        <zf:LinkButton ID="LinkButton2" runat="server" OnClick="Oper" CommandArgument='RecommendUp'
            OnClientClick="return confirm('是否确定要执行该操作');">选中<%=CTitle%>设置为精品</zf:LinkButton>
        <zf:LinkButton ID="LinkButton3" runat="server" OnClick="Oper" CommandArgument='RecommendDown'
            OnClientClick="return confirm('是否确定要执行该操作');">选中<%=CTitle%>取消精品设置</zf:LinkButton>
        <a href="<%=this.ManagePage %>?ot=AddNew&dt=1">发布<%=this.CTitle %></a>
    </div>
    <!--自定义按钮 结束-->
    <div class="fc_ mt10_">
    </div>
    <!--搜索 开始-->
    <div class="searchContainer  ">
        <table>
            <tr>
                <td class="l">
                    搜索选项:
                </td>
                <td class="m">
                    <div class="c">
                        <span class="t">物业名称:</span><span class="c">
                            <zf:TextBox runat="server" class="stxt" ID="tbTitle"></zf:TextBox></span> <span class="t">
                                物业类型:</span><span class="c">
                                    <zf:DropDownList runat="server" ID="ddlHouseType" class="stxt" AppendDataBoundItems="true">
                                        <asp:ListItem Value="-1" Text="未选择"></asp:ListItem>
                                    </zf:DropDownList>
                                </span>
                                
                                
                
                       <div>
                        <div class="fysearch">
                         <% var sp = new ZF.WS.house.Search(); %>
            <zf:TextBox runat="server" class="dttxt dn_ " ID="tbArea1" Text="0"  ></zf:TextBox>
            <zf:TextBox runat="server" class="dttxt dn_ " ID="tbArea2"  Text="0"  ></zf:TextBox>
                            <script>
                                var fyareajson = $.evalJSON('<%=sp.AreaChilds.JsonConvert() %>');
                            </script>

                            <span class="t">&nbsp;&nbsp;&nbsp;&nbsp;区域:</span><span class="c">
                                <select class=" area1" class="ddl">
                                    <option value='0' selected="selected">不 限</option>
                                </select>
                            </span><span class="t">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;商圈:</span><span class="c">
                                <select class=" area2"  class="ddl">
                                    <option value='0'>不 限</option>
                                </select>
                            </span>
                        </div>
                        <script>
                            var fysearch = $(".fysearch");
                            var area1 = fysearch.find(".area1")
                            var area1Value = $(".tbArea1").val();

                            $(fyareajson).each(function() {
                                area1.append(String.format("<option value='{0}' {2}>{1}</option>", this.Id, this.Name,
                                (this.Id + "" == area1Value) ? 'selected=selected' : ''));
                            });
                            $(function() {
                                fysearch.find(".area1").change(function() {
                                    var selId = this.value;
                                    $(".tbArea1").val(selId);
                                    $(".tbArea2").val("0");
                                    var area2 = fysearch.find(".area2");
                                    area2.find("option").remove();
                                    area2.append("<option value='0'>不 限</option>");
                                    var area1json = null;
                                    $(fyareajson).each(function() {
                                        if (this.Id + "" == selId) {
                                            area1json = this;
                                            return false;
                                        }
                                    });
                                    if (area1json != null) {
                                        $(area1json.Childs).each(function() {
                                            area2.append(String.format("<option value='{0}'>{1}</option>", this.Id, this.Name));
                                        });
                                    }
                                });
                                fysearch.find(".area2").change(function() {
                                    $(".tbArea2").val(this.value);
                                });
                            });
                        </script>
                        </div>
                        
                        
                        <div>
                     
                            <span class="t">价格范围:</span><span class="c">
                                <zf:TextBox runat="server" class="sstxt" ID="tbPrice1"></zf:TextBox>-<zf:TextBox
                                    runat="server" class="sstxt" ID="tbPrice2"></zf:TextBox>
                                <span class="zx_">单位：元/平米</span></span>
                               
                        </div>
                     <br />
                     &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <zf:Button runat="server" ID="Button2" Text="搜 索" OnClick="Search" class="linkbtn" />
                        <zf:Button runat="server" ID="Button1" Text="全 部" OnClick="AllList" class="linkbtn" />
                        
                        <div class="dn_">
                           <span class="t">&nbsp;&nbsp;发布时间(小于):</span><span class="c">
                                    <zf:TextBox runat="server" class="dttxt" ID="tbEndTime1" onfocus="calendar();"></zf:TextBox></span>
                        <span class="t">&nbsp;&nbsp;发布时间(大于):</span><span class="c">
                            <zf:TextBox runat="server" class="dttxt" ID="tbEndTime2" onfocus="calendar();"></zf:TextBox></span>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>
    <!--搜索 结束-->
</asp:Content>
